<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="./js/react.js"></script>
    <script src="./js/react-dom.js"></script>
    <script src="./js/babel.min.js"></script>
    <title>Document</title>
    <style>
      .abc {
        font-style: italic;
      }

      .def {
        font-weight: bold;
      }
    </style>
  </head>
  <body>
    <div id="root"></div>
    <script type="text/babel">
      let bgColor = 'green'
      let isFlag = false
      let style = { color: 'red', backgroundColor: bgColor, fontSize: '20px' }
      let classNames = 'abc ' + (isFlag ? 'def' : '')

      const appVnode = (
        <>
          <div className={classNames} style={style}>
            样式处理
          </div>
        </>
      )

      ReactDOM.createRoot(document.getElementById('root')).render(appVnode)
    </script>
  </body>
</html>
